<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<input type="hidden" id="dpParam" value="<s:property value="dpParam"/>"/>
<div class="modal-body">
<fieldset>
	<legend>
	  <span class="label  label-warning "> [请选择部门岗位信息]</span>
	</legend>
	<table>
	    <tr>
	        <td>
	            <ul class="list-group td-ul" id="ajax_users_config_depart">
                        <s:iterator value="departArrayList" id="list">
                           <li id="<s:property value="#list.departId"/>" class="list-group-item td-li">
                                <div class="checkbox">
                                    <label>
                                      <input id="<s:property value="#list.departId"/>" type="checkbox" class="checkbox style-0" <s:property value="#list.checked"/>>
                                      <span><s:property value="#list.departName" /></span>
                                    </label>
                                </div>

                            </li>
                        </s:iterator>
                </ul>
	        </td>
	        <td>
                <ul class="list-group td-ul" id="ajax_users_config_post">

                </ul>

	        </td>
	    </tr>
	</table>
</fieldset>
</div>
<div class="modal-footer">
	<a href="#ajax!flow.action" class="btn btn-primary" id="dialog-dp-ok">确定</a>
	<button class="btn" data-dismiss="modal" aria-hidden="true">取消</button>
</div>
<script>
    loadDataTableScripts();
	var actionUrl = "ajax-config!configPost.action";
	multList("ajax_users_config_depart","ajax_users_config_post",actionUrl);
    $("#dialog-dp-ok").unbind("click").bind("click",function(){
        var rowData = getRowIds("ajax_users_config_post");
        var rowNames=getRowNames("ajax_users_config_post");
        var dpParamValue=$("#dpParam").val();
        switch(dpParamValue){
            case 'pconfig':
                $("#sdepartpost").val("");
                $("#s_dp_selectIds").val(rowData);
                $("#sdepartpost").val($("#sdepartpost").val()+rowNames);
                break;
            case 'dpcreateParam':
                $("#dp_creater_selectIds").val(rowData);
                console.debug($("#dp_creater_selectIds").val());
                $("#dpcreater").val($("#dpcreater").val()+rowNames);
                break;
            case 'dpreadParam':
                $("#dp_read_selectIds").val(rowData);
                $("#dpread").val($("#dpread").val()+rowNames);
                break;
            case 'dpeditParam':
                $("#dp_edit_selectIds").val(rowData);
                $("#dpedit").val($("#dpedit").val()+rowNames);
                break;
            case 'dpdocParam':
                $("#dp_doc_selectIds").val(rowData);
                $("#dpdoc").val($("#dpdoc").val()+rowNames);
                break;
        }
        gDialog.fClose();
    });

</script>
